<script type="text/javascript">
function jsApiCall(){
	WeixinJSBridge.invoke(
		'getBrandWCPayRequest',
		{$jsApiParameters},
		function(res){
			WeixinJSBridge.log(res.err_msg);
			//alert(res.err_msg);
			if(res.err_msg == 'get_brand_wcpay_request:ok' ){
				location.href='__URL__/show?action=1&orderid={$orderid}';
			}else{
				location.href='__URL__/show?action=0&orderid={$orderid}';
			}
		}
	);
}
;(function(){
	if (typeof WeixinJSBridge == "undefined"){
		if( document.addEventListener ){
			document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
		}else if (document.attachEvent){
			document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
			document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
		}
	}else{
		jsApiCall();
	}
})();
</script>